﻿using System;
using System.Collections.Generic;
using NGinnBPM.Lib.Schema;

namespace NGinnBPM.Lib.Interfaces
{
    public interface IProcessPackageRepository
    {
        IList<string> PackageNames
        {
            get;
        }

        PackageDefinition GetPackage(string name);
        ProcessDefinition GetProcess(string name);

        /// <summary>
        /// Reload specified package. Used to notify system that process/package definition
        /// has changed and should be reloaded.
        /// If updated package definition is invalid, an exception will be thrown.
        /// If possible, previous version of package will stay loaded when an updated definition is invalid.
        /// </summary>
        /// <param name="name"></param>
        void ReloadPackage(string name);

        /// <summary>
        /// Return additional resource in a package
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        byte[] GetPackageResource(string package, string rcName);
    }
}
